﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AvatarHelper;
using Avatar.Model;

public partial class Company_ADStep1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            using (var _adc = DBHelper.GetDataContext())
            {
                ListView1.DataSource = _adc.ADCategory.Select(ad => new { CategoryName = ad.CategoryName, ID = ad.ID, Height = ad.Height, Width = ad.Width });
                ListView1.DataBind();
            }
        }
    }
    protected void btn_Next_Click(object sender, EventArgs e)
    {
        Button _btn = sender as Button;
        if (!string.IsNullOrEmpty(_btn.CommandArgument))
        {
            if (Session["AdCategoryID"] == null)
            {
                Session.Add("AdCategoryID", _btn.CommandArgument);
            }
            else
            {
                Session["AdCategoryID"] = _btn.CommandArgument;
            }
        }
        Response.Redirect("Company_ADStep2.aspx");
    }
}
